package com.winning.pmph;

import com.winning.pmph.schedule.SyncSchedule;
import com.winning.pmph.utils.ApplicationContextUtil;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

@Component
@ConditionalOnProperty(prefix = "scheduling", name = "enabled")
public class KmsApplicationRunner implements ApplicationRunner {

    //项目启动后执行的方法
    @Override
    public void run(ApplicationArguments args) throws Exception {
        ApplicationContextUtil.getBean(SyncSchedule.class).getMessage();
    }
}